package com.m2bshop.shop.service.impl;

import com.m2bshop.shop.dao.BrandDao;
import com.m2bshop.shop.pojo.Brand;
import com.m2bshop.shop.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.UUID;

@Service
public class BrandServiceImpl implements BrandService {

    @Autowired
    private BrandDao brandDao;

    @Override
    public List<Brand> findBrandAll() {
        return brandDao.selectBrandAll();
    }

    @Override
    public List<Brand> findBrandByComId(Integer companyId) {
        System.out.println("service companyId:"+companyId);
        return brandDao.selectBrandByComId(companyId);
    }

    @Override
    public void addBrand(Brand brand) {
        brandDao.insertBrand(brand);
    }

    @Override
    public void updateBrand(Brand brand) {
        brandDao.updateBrand(brand);
    }

    @Override
    public void updateBrandState(Integer brandId, String state) {
        System.out.println("service brandId:"+brandId+"   state:"+state);
        brandDao.updateBrandState(brandId, state);
    }


}
